define(['hy5b/animation/add-reduce'], function(addReduce) {
  
  function manualControlHelp(params, cb, elem) {
    var props = {}
    _.each(params, function(v, param) {
      let val = v;
      let delta;
      if (val.length > 0) {
        delta = val[1]
        val = val[0]
        params[param] = val
      }
      
      props[param] = {
        start: 0,
        end: val
      }

      elem.appendChild(
        addReduce({
          set: (function(param) {
            return function(value) {
              params[param] = value;
              cb()
            }
          }(param)),
          key: param,
          val: val,
          delta: delta
        })
      )

      elem.appendChild(document.createElement('br'))
    })

    return props;
  }

  return manualControlHelp;
})
